package com.ewanghuiju.app.widget.popupwindow;

import android.content.Context;
import android.view.View;

import com.ewanghuiju.app.R;

import butterknife.ButterKnife;
import butterknife.OnClick;
import razerdp.basepopup.BasePopupWindow;

/**
 * @author sj  qq:751943509
 * @class 解绑微信弹框的弹框
 * @time 2020/2/19
 */
public class UnbindwxBasePopup extends BasePopupWindow {

    private PopupItemClickCallback popupItemClickCallback;

    public UnbindwxBasePopup(Context context, PopupItemClickCallback popupItemClickCallback) {
        super(context);
        ButterKnife.bind(this, getContentView());
        this.popupItemClickCallback = popupItemClickCallback;
    }

    @Override
    public View onCreateContentView() {
        return createPopupById(R.layout.popup_unbind_wx);
    }

    @OnClick({R.id.tv_unbind, R.id.tv_cancel, R.id.iv_close})
    public void doClick(View view) {
        int id = view.getId();
        switch (id) {
            case R.id.tv_unbind:
                dismiss();
                if (popupItemClickCallback != null) {
                    popupItemClickCallback.onSureCallback("");
                }
                break;
            case R.id.tv_cancel:
            case R.id.iv_close:
                dismiss();
                break;
            default:
                break;
        }
    }

}
